package com.southpark.demo.view.pages.home.renderers.dataRenderer
{
	import com.southpark.demo.interfaces.toolTips.IDataToolTip;
	import com.southpark.demo.view.BaseViewController;
	import com.southpark.demo.view.pages.home.renderers.dataRenderer.interfaces.IDataRendererCtrl;
	import com.southpark.demo.view.pages.home.renderers.dataRenderer.interfaces.IDataRendererUI;
	import com.southpark.demo.vo.data.DataItemVO;
	import com.southpark.system.view.toolTips.ToolTipTarget;
	
	import mx.core.UIComponent;
	
	
	public class DataRendererCtrl extends BaseViewController implements IDataRendererCtrl
	{		
		
		public function DataRendererCtrl(view:IDataRendererUI)
		{
			super();
			this.view = view;
		}

		
		/**
		 * IDataRendererCtrl
		 */
		private var view:IDataRendererUI;
		
		
		private var _toolTipTarget:ToolTipTarget;
		
		[Bindable]
		public function set toolTipTarget(value:ToolTipTarget):void {_toolTipTarget = value};
		public function get toolTipTarget():ToolTipTarget {return _toolTipTarget};
		
		
		private var _dataItem:DataItemVO;
		
		[Bindable]
		public function set dataItem(value:DataItemVO):void {_dataItem = value};
		public function get dataItem():DataItemVO {return _dataItem};
		
		
		public function set data(value:Object):void
		{
			dataItem = value as DataItemVO;
		}
		
		public function createToolTipTarget(origin:UIComponent):void
		{
			toolTipTarget = new ToolTipTarget(applicationManager.toolTipManager,origin,IDataToolTip);
		}
		
		public function showToolTip():void
		{
			toolTipTarget.showToolTip(dataItem);
		}
		
		
	}
}